<template>
    <div>   <HomeHeader  :type_="type_"></HomeHeader>
       <v-content>
           <v-container>
            <v-card>
                <v-toolbar flat color="primary" dark>
                    <v-toolbar-title>进行排班</v-toolbar-title>
                </v-toolbar>
                <v-tabs vertical>
                    <v-tab  v-for="(item, i) in items" :key="i">{{item.dep_name}}
                    </v-tab>
                    <v-tab-item  v-for="(item) in items" :key="item.dep_name">
                        <v-row justify="center">
                            <v-date-picker v-model="date" @click:date="test(item)"></v-date-picker>
                        </v-row> </v-tab-item>
                </v-tabs>
            </v-card></v-container>
        </v-content>
    </div>
</template>
<script>
export default {
  name:"Home",
    data(){
    return{
        type_:'adm',
        date:new Date().toISOString().substr(0, 10),
        items: [  ],
     }
  },methods:{
      test(a){
          this.$router.push({name:'paibantable',query:{date:this.date,dep_name:a.dep_name,dep_id:a.dep_id}})
      },_begin(){
            var params ={_option:'1024'}
            this.$http.post(params,2).then((res)=>{
                let { resultCode, resultObject, resultMsg } = res
                if (resultCode === '0') {
                    if (resultObject) {
                        this.items=resultObject.dataList
                    } else {
                        this.items=[]
                    }
                } else {
                    this.items=[]
                    this.response=resultMsg
                }
            })
        }
    },mounted(){
      this._begin()
    }
 }
</script>

<style scoped>
</style>

